<?php
require 'db.php';
require 'function.php';
$admin1 = new Manager($link);
$id = $_GET['id'];

    if (isset($_POST['submit'])){
        
        $admin = $_POST['admin'];
        $status = $_POST['status'];
        $password = $_POST['password'];
        $email = $_POST['email'];
        $phone = $_POST['phone'];
        
        $query = $admin1->editUser($admin, $password,$email,$phone, $id);
        if ($query){
            header("Location:m_user.php");
        }
        else{
            echo "<script>alert('修改失败！');</script>";
            echo "<script>history.go(-1);</script>";
            exit();
        }
    }




$data = $admin1->getUserById($id);
require 'uedit.html';
?>